import java.util.Scanner;

public class Practise1 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String str = in.nextLine();
        String[] arr = str.split(":");
        int num1 = Integer.parseInt(arr[0]);
        if(num1 < 6) {
            num1 += 24 ;
        } else if (num1 >= 24) {
            num1 %= 24;
        }
        if(num1 < 10) {
            System.out.print(0);
        }
        System.out.println(num1 + ":" + arr[1]);

    }
}
